package com.sync.syncmasterdata.product.repository.oa;

import com.sync.syncmasterdata.product.entity.oa.ProductWorkflowDeleteEntity;
import com.sync.syncmasterdata.product.entity.oa.ProductWorkflowUpdateEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface InventoryForDeleteWorkflowRepository extends JpaRepository<ProductWorkflowDeleteEntity,String> {

    /**
     * 产品 停用时的表单
     */
    @Query(nativeQuery = true,value="select dt3.id,TO_CHAR(main.REQUESTID) as requestid,dt3.inventory_code,dt3.product_name,dt3.bpmid,dt3.crmid from formtable_main_322 main inner join formtable_main_322_dt3 dt3 on dt3.mainid=main.id  where main.REQUESTID=:requestid")
    List<ProductWorkflowDeleteEntity> getProductWorkflowEntityForDelete(@Param(value = "requestid") String requestid);

}
